package com.project.controller;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.project.bean.BuyInfoBean;
import com.project.bean.BuyOrderBean;
import com.project.service.IBuyInfoService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.time.LocalDate;

@RestController
@RequestMapping("buyInfo")
public class BuyInfoController {
    @Autowired
    private IBuyInfoService buyInfoService;

    @RequestMapping("findByItem")
    public IPage<BuyOrderBean> findByItem (Integer pageNO, String supplierName, LocalDate startDate, LocalDate endDate){
        return buyInfoService.findByItem(pageNO, supplierName, startDate, endDate);
    }

    @RequestMapping("findByOrderId")
    public BuyOrderBean findByOrderId(Integer buyOrderId){
        return buyInfoService.findByOrderId(buyOrderId);
    }

}
